*******************************************************************************
***********************  Free to move, reluctant to share: ********************
*** Unequal opposition to transnational rights under EU freedom of movement ***
********************* A. Sojka, L. Talving, S. Vasilopoulou *******************
******************************** Version Oct 2023 *****************************
*******************************************************************************



/// DATA PREPARATION ///

*** Dependent variables ***

*EU citizen rights in the UK

*As part of the Brexit deal, EU citizens should NOT have the right to live in the UK 
*As part of the Brexit deal, EU citizens should have the right to live in the UK
recode UY2a_1 997=., gen(EU_live) // 0-10 scale; high = have the right to live
label variable EU_live "EU citizens' right to live in the UK"
tab EU_live
sum EU_live

*As part of the Brexit deal, EU citizens should NOT have the right to work in the UK 
*As part of the Brexit deal, EU citizens should have the right to work in the UK
recode UY2a_2 997=., gen(EU_work) // 0-10 scale; high = have the right to work in the UK
label variable EU_work "EU citizens' right to work in the UK"
tab EU_work
sum EU_work

*As part of the Brexit deal, EU citizens should NOT have the right to do business in the UK 
*As part of the Brexit deal, EU citizens should have the right to do business in the UK
recode UY2a_3 997=., gen(EU_busin) // 0-10 scale; high = have the right to do business in the UK
label variable EU_busin "EU citizens' right to do business in the UK"
tab EU_busin
sum EU_busin

*As part of the Brexit deal, EU citizens should NOT be allowed to claim welfare benefits in the UK  
*As part of the Brexit deal, EU citizens should be allowed to claim welfare benefits in the UK
recode UY2a_4 997=., gen(EU_welf) // 0-10 scale; high = allowed to claim benefits in the UK
label variable EU_welf "EU citizens' right to receive welfare in the UK"
tab EU_welf
sum EU_welf

*UK citizens' rights in the EU

*Thinking about the following, where would you place your views on the scale below?
*As part of the Brexit deal, UK citizens should NOT have the right to live in other EU member states 
*As part of the Brexit deal, UK citizens should have the right to live in other EU member states
recode UY2b_1 997=., gen(UK_live) // 0-10 scale; high = have the right 
tab UK_live
sum UK_live

*As part of the Brexit deal, UK citizens should NOT have the right to work in other EU member states 
*As part of the Brexit deal, UK citizens should have the right to work in other EU member states
recode UY2b_2 997=., gen(UK_work) // 0-10 scale; high = have the right
tab UK_work
sum UK_work

*As part of the Brexit deal, UK citizens should NOT have the right to do business in other EU member states 
*As part of the Brexit deal, UK citizens should have the right to do business in other EU member states
recode UY2b_3 997=., gen(UK_busin) // 0-10 scale; high = have the right
tab UK_busin
sum UK_busin

*As part of the Brexit deal, UK citizens should ONLY receive welfare benefits in the UK 
*As part of the Brexit deal, UK citizens should receive welfare benefits anywhere in the EU
recode UY2b_4 997=., gen(UK_welf) // 0-10 scale; high = should receive welfare benefits in the EU
tab UK_welf
sum UK_welf

*** Independent variables and controls ***

codebook UY11, tab(100)
recode UY11 1=1 2/4=0 5/6=., gen(Excl_id)
label define Excl_id 1 "Exclusive" 0 "Inclusive"
label values Excl_id Excl_id
tab UY11 Excl_id, m
tab Excl_id, m

codebook Education_Level, tab(100)
recode Education_Level 1/2=1 4/5=1 8/10=1 3=2 6/7=2 11/15=2 18=2 16/17=3 19/20=., gen(Edu_level)
label define Edu_level 1 "Low" 2 "Medium" 3 "High"
label values Edu_level Edu_level
tab Edu_level, m

codebook EURef_2016, tab(10)
recode EURef_2016 1=0 2=1 3/4=., gen(Ref_vote)
label define Ref_vote 1 "Leave" 0 "Remain"
label values Ref_vote Ref_vote
tab EURef_2016 Ref_vote, m

codebook UY3_6, tab(100)
recode UY3_6 997=., gen(Imm_ec)
label define Imm_ec 0 "Immigration is bad for British economy" 10 "Immigration is good for British economy"
label values Imm_ec Imm_ec
tab Imm_ec, m

codebook UY3_7, tab(100)
recode UY3_7 997=., gen(Imm_cul)
label define Imm_cul 0 "Immigration is bad for British culture" 10 "Immigration is good for British culture"
label values Imm_cul Imm_cul
tab Imm_cul, m

corr Imm_ec Imm_cul
alpha Imm_ec Imm_cul 

gen Imm_index=Imm_ec+Imm_cul
tab Imm_index
*histogram Imm_index, percent
//turn the scale around:
replace Imm_index=20-(Imm_ec+Imm_cul)
tab Imm_index
*histogram Imm_index, percent
//higher values = opposed to immigration

codebook Work_Status, tab(100)
recode Work_Status 1/3=1 4/7=0 8=., gen(Work_status)
label define Work_status 1 "Working" 0 "Not working" 
labe values Work_status Work_status
tab Work_status Work_Status, m
tab Work_status, m

codebook UY10, tab(100)
recode UY10 12=., gen(LR)
label define LR 1 "0=left" 11 "11=right"
label values LR LR
tab LR, m

gen LR2=LR^2
tab LR2, m

sum Age

codebook Gender
recode Gender 1=0 2=1, gen(Female)
tab Female Gender

//Standardising all variables on 0-1

sum Excl_id
sum Ref_vote

sum Imm_index
gen Imm_index_std=(Imm_index-`r(min)') / (`r(max)'-`r(min)')
tab Imm_index_std 

sum Edu_level
gen Edu_level_std=(Edu_level-`r(min)') / (`r(max)'-`r(min)')
tab Edu_level_std 

sum Work_status
gen Work_status_std=(Work_status-`r(min)') / (`r(max)'-`r(min)')
tab Work_status_std 

sum Age
gen Age_std=(Age-`r(min)') / (`r(max)'-`r(min)')
sum Age_std 

sum LR
gen LR_std=(LR-`r(min)') / (`r(max)'-`r(min)')
tab LR_std 



/// ANALYSIS ///

*** Variable description

* TABLE A1 Descriptive statistics of all variables (Appendix) ***

eststo clear
estpost sum EU_live EU_work EU_busin EU_welf UK_live UK_work UK_busin UK_welf Ref_vote Excl_id Edu_level Imm_index Work_status LR Age Gender


*** Descriptive analysis ***

*FIGURE 1 Support for transnational rights for UK citizens in the EU and EU citizens in the UK ***

recode EU_live 0/3=1 4/6=2 7/10=3, gen(EU_live_1)
recode EU_work 0/3=1 4/6=2 7/10=3, gen(EU_work_1)
recode EU_busin 0/3=1 4/6=2 7/10=3, gen(EU_busin_1)
recode EU_welf 0/3=1 4/6=2 7/10=3, gen(EU_welf_1)
recode UK_live 0/3=1 4/6=2 7/10=3, gen(UK_live_1)
recode UK_work 0/3=1 4/6=2 7/10=3, gen(UK_work_1)
recode UK_busin 0/3=1 4/6=2 7/10=3, gen(UK_busin_1)
recode UK_welf 0/3=1 4/6=2 7/10=3, gen(UK_welf_1)

histogram EU_live_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("EU citizens' right to {bf:live} in the UK", size(medium) margin(medium)) ///
	name(EU_live, replace) ///
	nodraw
histogram UK_live_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("UK citizens' right to {bf:live} in the EU", size(medium) margin(medium)) ///
	name(UK_live, replace) ///
	nodraw
histogram EU_work_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("EU citizens' right to {bf:work} in the UK", size(medium) margin(medium)) ///
	name(EU_work, replace) ///
	nodraw
histogram UK_work_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("UK citizens' right to {bf:work} in the EU", size(medium) margin(medium)) ///
	name(UK_work, replace) ///
	nodraw
histogram EU_busin_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("EU citizens' right to {bf:do business} in the UK", size(medium) margin(medium)) ///
	name(EU_busin, replace) ///
	nodraw
histogram UK_busin_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("UK citizens' right to {bf:do business} in the EU", size(medium) margin(medium)) ///
	name(UK_busin, replace) ///
	nodraw
histogram EU_welf_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("EU citizens' right to {bf:receive welfare} in the UK", size(medium) margin(medium)) ///
	name(EU_welf, replace) ///
	nodraw
histogram UK_welf_1, ///
	percent ///
	bcolor(gs13) ///
	barwidth(0.5) ///
	addlabels addlabopts(yvarformat(%5.1f)) ///
	xlabel(1(1)3) ///
	xlabel(1 "Against" 2 "Neutral" 3 "For") ///
	xlabel(,labsize(small)) ///
	ylabel(, nolabel noticks nogrid) ///
	graphregion(color(white) lwidth(large)) ///
	xtitle("") ///
	ytitle("") ///
	title("UK citizens' right to {bf:receive welfare} in the EU", size(medium) margin(medium)) ///
	name(UK_welf, replace) ///
	nodraw
graph combine UK_live EU_live UK_work EU_work UK_busin EU_busin UK_welf EU_welf, ycommon rows(3) cols(2) graphregion(color(white))


*FIGURE 2 Mean values of attitudes towards transnational rights, with 95% confidence intervals ***

sum EU_live EU_work EU_busin EU_welf UK_live UK_work UK_busin UK_welf
tabstat EU_live EU_work EU_busin EU_welf UK_live UK_work UK_busin UK_welf, statistics(mean)

ciplot EU_live EU_work EU_busin EU_welf UK_live UK_work UK_busin UK_welf, hor ///
	msymbol(o o o o o o o o) mcolor(gs1 gs1 gs1 gs1 gs1 gs1 gs1 gs1) ///
	scheme(s1mono) ///
	title("Mean with 95% CI", size(small)) ///
	xlabel(0 `""0 - Should not" "have the right""' 10 `""10 - Should" "have the right "', labsize(vsmall)) xmtick(0(1)10)  ///
	ylabel(2 "EU citizens to live in the UK " 4 "EU citizens to work in the UK " 6 "EU citizens to do business in the UK " /// 
		8 "EU citizens to receive welfare in the UK " 10 "UK citizens to live in the EU " ///
		12 "UK citizens to work in the EU " 14 "UK citizens to do business in the EU " 16 "UK citizens to receive welfare in the EU ") ///
		yline(9, lcolor(gs15)) ///
	note("")
	
	

*FIGURE 3 Support for transnational rights for EU citizens in the UK, by national identification and level of education ***

codebook UY11, tab(100)
recode UY11 1=1 2/4=2 5/6=., gen(Brit_id_2)
label define Brit_id_2 1 "Excl" 2 "Incl" 
label values Brit_id_2 Brit_id_2
tab UY11 Brit_id_2, m
tab Brit_id_2, m

tab Edu_level

grmeanby Brit_id_2 Edu_level, sum(EU_live) ///
	title(EU citizens' right to {bf:live} in the UK, size(medsmall)) ///
	ylabel(0(2)10) ///
	xlabel("") ///
	xtick(1 2) ///
	scheme(s1mono) ///
	lcolor(gs8) ///
	name(fig2_live, replace) nodraw
	
grmeanby Brit_id_2 Edu_level, sum(EU_work) ///
	title(EU citizens' right to {bf:work} in the UK, size(medsmall)) ///
	ylabel(0(2)10) ///
	xlabel("") ///
	xtick(1 2) ///
	scheme(s1mono) ///
	lcolor(gs8) ///
	name(fig2_work, replace) nodraw
	 
grmeanby Brit_id_2 Edu_level, sum(EU_busin) ///
	title(EU citizens' right to {bf:do business} in the UK, size(medsmall)) ///
	ylabel(0(2)10) ///
	xlabel(1 "British identity" 2 "Education level", labsize(small)) ///
	scheme(s1mono) ///
	lcolor(gs8) ///
	name(fig2_busin, replace) nodraw
	
grmeanby Brit_id_2 Edu_level, sum(EU_welf) ///
	title(EU citizens' right to {bf:receive welfare} in the UK, size(medsmall)) ///
	ylabel(0(2)10) ///
	xlabel(1 "British identity" 2 "Education level", labsize(small)) ///
	scheme(s1mono) ///
	lcolor(gs8) ///
	name(fig2_welf, replace) nodraw
	
graph combine fig2_live fig2_work fig2_busin fig2_welf, cols(2) graphregion(color(white))


*TABLE A2. Support for EU citizens' rights in the UK by national identification and level of education (Appendix) ***

oneway EU_live Brit_id_2, mean
oneway EU_work Brit_id_2, mean
oneway EU_busin Brit_id_2, mean
oneway EU_welf Brit_id_2, mean
ci mean EU_live EU_work EU_busin EU_welf if Brit_id_2==1
ci mean EU_live EU_work EU_busin EU_welf if Brit_id_2==2
oneway EU_live Edu_level, mean
oneway EU_work Edu_level, mean
oneway EU_busin Edu_level, mean
oneway EU_welf Edu_level, mean
ci mean EU_live EU_work EU_busin EU_welf if Edu_level==1
ci mean EU_live EU_work EU_busin EU_welf if Edu_level==2
ci mean EU_live EU_work EU_busin EU_welf if Edu_level==3




*** Explanatory analysis ***

* TABLE 1 Models of support for EU citizens' rights in the UK ***

eststo clear 

eststo: reg EU_live i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
estimates store M1
vif 

eststo: reg EU_work i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
estimates store M2
vif

eststo: reg EU_busin i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
estimates store M3
vif

eststo: reg EU_welf i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
estimates store M4
vif

estimates table M1 M2 M3 M4, b(%7.3f) se(%7.3f) stats(N r2)
esttab using Main_models_Feb.rtf, b(2) se(2) r2 star(* 0.10 ** 0.05 *** 0.01) label compress onecell parentheses replace 

*Predicted means (manuscript p. 23)

reg EU_welf i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, at(Excl_id=(0 1)) atmeans vsquish

reg EU_live i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, at(Excl_id=(0 1)) atmeans vsquish

reg EU_work i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, at(Excl_id=(0 1)) atmeans vsquish

reg EU_busin i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, at(Excl_id=(0 1)) atmeans vsquish

reg EU_welf i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, at(Edu_level=(1 2 3)) atmeans vsquish
marginsplot

reg EU_welf i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, at(LR_std=(0(0.1)1)) atmeans vsquish
marginsplot



* Interaction models for welfare rights


* TABLE A3 Interaction effects of national identification and level of education on EU citizens' welfare rights in the UK (Appendix) ***

eststo clear 

eststo: reg EU_welf i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
estimates store M1
vif

eststo: reg EU_welf ib(2).Edu_level##i.Ref_vote i.Excl_id c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
estimates store M2
vif

estimates table M1 M2, b(%7.3f) se(%7.3f) stats(N r2)
esttab using Int_welf_Feb.rtf, b(2) se(2) r2 star(* 0.10 ** 0.05 *** 0.01) label compress onecell parentheses replace 

tab Excl_id Ref_vote, col


*Interaction models with identity & referendum vote and all four rights


* TABLE A4 Interaction effects of national identification on EU citizens' rights in the UK (Appendix)

reg EU_live i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg EU_work i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg EU_busin i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg EU_welf i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)


*Interaction graphs with identity & referendum vote for all four rights


* FIGURE 4. Interaction effects of national identification and Euroscepticism on EU citizens' welfare rights in the UK

reg EU_live i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
margins, atmeans vsquish 
margins, at(Ref_vote=(0 1) Excl_id=(0 1)) atmeans vsquish
marginsplot, recast(scatter) ///
	recastci(rspike) ciopts(color(%50)) ///
	xscale(range(-0.5(1)2)) ///
	yline(7.129673, lwidth(thin) lcolor(red) lpattern(dash)) ///
	scheme(s2mono) graphregion(color(white)) ///
	xtitle("") ///
	ytitle("") ///
	title(EU citizens' right to {bf:live} in the UK, size(medsmall)) ///
	xlabel(0 `""Voted" "Remain""' 1 `""Voted" "Leave""') ///
	ylabel(4(2)8) ///
	ylabel(,nogrid) ///
	plot1opts(mlabel(Excl_id) mlabp(2)) ///
		plot2opts(mlabel(Excl_id) mlabp(4)) ///
	legend(off) ///
	name(id_live, replace) ///
	nodraw

reg EU_work i.Excl_id##i.Ref_vote c.Imm_index_std ib(2).Edu_level c.Work_status_std c.Age_std ib(0).Female c.LR_std##c.LR_std, cluster(Region)
margins, atmeans vsquish 
margins, at(Ref_vote=(0 1) Excl_id=(0 1)) atmeans vsquish
marginsplot, recast(scatter) ///
	recastci(rspike) ciopts(color(%50)) ///
	xscale(range(-0.5(1)2)) ///
	yline(7.240625, lwidth(thin) lcolor(red) lpattern(dash)) ///
	scheme(s2mono) graphregion(color(white)) ///
	xtitle("") ///
	ytitle("") ///
	title(EU citizens' right to {bf:work} in the UK, size(medsmall)) ///
	xlabel(0 `""Voted" "Remain""' 1 `""Voted" "Leave""') ///
	ylabel(4(2)8) ///
	ylabel(,nogrid) ///
	plot1opts(mlabel(Excl_id) mlabp(2)) ///
		plot2opts(mlabel(Excl_id) mlabp(4)) ///
	legend(off) ///
	name(id_work, replace) ///
	nodraw

reg EU_busin i.Excl_id##i.Ref_vote c.Imm_index_std ib(2).Edu_level c.Work_status_std c.Age_std ib(0).Female c.LR_std##c.LR_std, cluster(Region)
margins, atmeans vsquish 
margins, at(Ref_vote=(0 1) Excl_id=(0 1)) atmeans vsquish
marginsplot, recast(scatter) ///
	recastci(rspike) ciopts(color(%50)) ///
	xscale(range(-0.5(1)2)) ///
	yline(8.040381, lwidth(thin) lcolor(red) lpattern(dash)) ///
	scheme(s2mono) graphregion(color(white)) ///
	xtitle("") ///
	ytitle("") ///
	title(EU citizens' right to {bf:do business} in the UK, size(medsmall)) ///
	xlabel(0 `""Voted" "Remain""' 1 `""Voted" "Leave""') ///
	ylabel(4(2)8) ///
	ylabel(,nogrid) ///
	plot1opts(mlabel(Excl_id) mlabp(2)) ///
		plot2opts(mlabel(Excl_id) mlabp(4)) ///
	legend(off) ///
	name(id_busin, replace) ///
	nodraw

reg EU_welf i.Excl_id##i.Ref_vote c.Imm_index_std ib(2).Edu_level c.Work_status_std c.Age_std ib(0).Female c.LR_std##c.LR_std, cluster(Region)
margins, atmeans vsquish 
margins, at(Ref_vote=(0 1) Excl_id=(0 1)) atmeans vsquish
marginsplot, recast(scatter) ///
	recastci(rspike) ciopts(color(%50)) ///
	xscale(range(-0.5(1)2)) ///
	yline(4.2211, lwidth(thin) lcolor(red) lpattern(dash)) ///
	scheme(s2mono) graphregion(color(white)) ///
	xtitle("") ///
	ytitle("") ///
	title(EU citizens' right to {bf:receive welfare} in the UK, size(medsmall)) ///
	xlabel(0 `""Voted" "Remain""' 1 `""Voted" "Leave""') ///
	ylabel(4(2)8) ///
	ylabel(,nogrid) ///
	plot1opts(mlabel(Excl_id) mlabp(2)) ///
		plot2opts(mlabel(Excl_id) mlabp(4)) ///
	legend(off) ///
	name(id_welf, replace) ///
	nodraw

graph combine id_live id_work id_busin id_welf, cols(2) graphregion(color(white)) 




***Robustness tests***

* Main models with fixed effects

* TABLE A5. Robustness test: fixed effects models of support for EU citizens' rights in the UK (Appendix)

reg EU_live i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region
reg EU_work i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region
reg EU_busin i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region
reg EU_welf i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region


*Interaction models with fixed effects

* TABLE A6 Robustness test: fixed effects interaction models of national identification effects on EU citizens' rights in the UK (Appendix)

reg EU_live i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region
reg EU_work i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region
reg EU_busin i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region
reg EU_welf i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female ib(7).Region


* Main models for UK citizens' rights in the EU

* TABLE A7 Robustness test: models of support for UK citizens' rights in the EU (Appendix)

reg UK_live i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg UK_work i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg UK_busin i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg UK_welf i.Excl_id ib(2).Edu_level i.Ref_vote c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)


* Interaction models for UK citizens' rights in the EU

* TABLE A8 Robustness test: interaction effects of national identification on UK citizens' rights in the EU (Appendix)

reg UK_live i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg UK_work i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg UK_busin i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
reg UK_welf i.Excl_id##i.Ref_vote ib(2).Edu_level c.Imm_index_std c.Work_status_std c.LR_std##c.LR_std c.Age_std ib(0).Female, cluster(Region)
